package com.eng.carro.mb;

import java.io.Serializable;

import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;

@ManagedBean
@SessionScoped
public class MenuView implements Serializable {

  private static final long serialVersionUID = 3074755693951420814L;
  
  private String redirectPage = "empty";
  
  public void save() {
  }

  public void update() {
	setRedirectPage("routes");
  }

  public void delete() {
	setRedirectPage("users");
  }
  
  public void order() {
	setRedirectPage("order");
  }
  
  public void postoDeEntrega() {
	setRedirectPage("places");
  }
  
  public String getRedirectPage() {
    return redirectPage;
  }

  public void setRedirectPage(String redirectPage) {
    this.redirectPage = redirectPage;
  }

  public void addMessage(String summary, String detail) {
	FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO,
		summary, detail);
	FacesContext.getCurrentInstance().addMessage(null, message);
  }
}